<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 400px;
            height: 600px;
            background-color: pink;
            margin: 100px auto;
            color: #33e5aa;
            text-align: center;
            font-size: 60px;
        }
    </style>
</head>

<body>
    <div>0</div>
    <script>
        const box = document.querySelector('div')
        let timer
        function throttle(fn, t) {
            let timer = null
            return function () {
                if (!timer) {
                    timer = setTimeout(function () {
                        fn()
                        timer = null
                    }, t)
                }
            }

        }
        let i = 1
        function num() {
            box.innerHTML = i++
        }
        box.addEventListener('mousemove', throttle(num, 3000))

    </script>
</body>

</html>